<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>更新日志</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.wordwrap.html">wordwrap</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="refs.basic.vartype.html">变量与类型相关扩展</a></div>
 <div class="up"><a href="book.strings.html">字符串</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="changelog.strings" class="appendix">
  <h1>更新日志</h1>

  <p class="para">对本扩展的类／函数／方法有以下更新。</p>
  <table class='doctable table' rules='groups'><thead><tr><th>Version</th><th>Function</th><th>Description</th></tr></thead><tbody class="gen-changelog v"><tr><td>5.5.1</td><td><a href='function.hex2bin.html'>hex2bin</a></td><td>A warning is thrown if the input string is invalid hexadecimal string.</td></tr></tbody><tbody class="gen-changelog v5-5-1"><tr><td>5.4.1</td><td><a href='function.hex2bin.html'>hex2bin</a></td><td>A warning is thrown if the input string is of odd length. In PHP 5.4.0 the string
        was silently accepted, but the last byte was truncated.</td></tr></tbody><tbody class="gen-changelog v5-4-1"><tr><td>5.4.0</td><td><a href='function.get-html-translation-table.html'>get_html_translation_table</a></td><td>The constants ENT_HTML401, ENT_XML1,
        ENT_XHTML and ENT_HTML5 were added.</td></tr><tr><td>&nbsp;</td><td><a href='function.get-html-translation-table.html'>get_html_translation_table</a></td><td>The default value for the encoding parameter was
        changed to UTF-8.</td></tr><tr><td>&nbsp;</td><td><a href='function.html-entity-decode.html'>html_entity_decode</a></td><td>Default encoding changed from ISO-8859-1 to UTF-8.</td></tr><tr><td>&nbsp;</td><td><a href='function.html-entity-decode.html'>html_entity_decode</a></td><td>The constants ENT_HTML401, ENT_XML1,
        ENT_XHTML and ENT_HTML5 were added.</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlentities.html'>htmlentities</a></td><td>The default value for the encoding parameter was
        changed to UTF-8.</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlentities.html'>htmlentities</a></td><td>The constants ENT_SUBSTITUTE, ENT_DISALLOWED,
        ENT_HTML401, ENT_XML1,
        ENT_XHTML and ENT_HTML5 were added.</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlspecialchars.html'>htmlspecialchars</a></td><td>The default value for the encoding parameter was
        changed to UTF-8.</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlspecialchars.html'>htmlspecialchars</a></td><td>The constants ENT_SUBSTITUTE, ENT_DISALLOWED,
        ENT_HTML401, ENT_XML1,
        ENT_XHTML and ENT_HTML5 were added.</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlspecialchars-decode.html'>htmlspecialchars_decode</a></td><td>增加了 ENT_HTML401、ENT_XML1、
        ENT_XHTML 和 ENT_HTML5 等常量。</td></tr><tr><td>&nbsp;</td><td><a href='function.number-format.html'>number_format</a></td><td>This function now supports multiple bytes in
        dec_point and
        thousands_sep. Only the first byte of each
        separator was used in older versions.</td></tr></tbody><tbody class="gen-changelog v5-4-0"><tr><td>5.3.4</td><td><a href='function.get-html-translation-table.html'>get_html_translation_table</a></td><td>The encoding parameter was added.</td></tr></tbody><tbody class="gen-changelog v5-3-4"><tr><td>5.3.2</td><td><a href='function.crypt.html'>crypt</a></td><td>基于 Ulrich Drepper 的实现，新增基于 SHA-256 算法和 SHA-512 算法的 crypt。</td></tr><tr><td>&nbsp;</td><td><a href='function.crypt.html'>crypt</a></td><td>修正了 Blowfish 算法由于非法循环导致的问题，返回&ldquo;失败&rdquo;字符串（&ldquo;*0&rdquo; 或 &ldquo;*1&rdquo;）而不是转而使用 DES 算法。</td></tr></tbody><tbody class="gen-changelog v5-3-2"><tr><td>5.3.0</td><td><a href='function.crypt.html'>crypt</a></td><td>PHP 现在包含了它自己的 MD5 Crypt 实现，包括标准 DES 算法，扩展的 DES 算法以及 Blowfish 算法。如果系统缺乏相应的实现，那么 PHP 将使用它自己的实现。</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlentities.html'>htmlentities</a></td><td>The constant ENT_IGNORE was added.</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlspecialchars.html'>htmlspecialchars</a></td><td>The constant ENT_IGNORE was added.</td></tr><tr><td>&nbsp;</td><td><a href='function.nl2br.html'>nl2br</a></td><td>新增可选的 is_xhtml 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.setlocale.html'>setlocale</a></td><td>This function now throws an E_DEPRECATED notice if a string is passed 
        to the category parameter instead of one of the 
        LC_* constants.</td></tr><tr><td>&nbsp;</td><td><a href='function.stristr.html'>stristr</a></td><td>新增可选的 before_needle 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.strlen.html'>strlen</a></td><td>Prior versions treated arrays as the string Array, thus returning
       a string length of 5 and emitting an E_NOTICE level error.</td></tr><tr><td>&nbsp;</td><td><a href='function.strstr.html'>strstr</a></td><td>新增可选的 before_needle 参数。</td></tr></tbody><tbody class="gen-changelog v5-3-0"><tr><td>5.2.5</td><td><a href='function.addcslashes.html'>addcslashes</a></td><td>The escape sequences \v and \f were added.</td></tr></tbody><tbody class="gen-changelog v5-2-5"><tr><td>5.2.3</td><td><a href='function.htmlentities.html'>htmlentities</a></td><td>The double_encode parameter was added.</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlspecialchars.html'>htmlspecialchars</a></td><td>The double_encode parameter was added.</td></tr></tbody><tbody class="gen-changelog v5-2-3"><tr><td>5.2.2 - 5.2.6</td><td><a href='function.substr.html'>substr</a></td><td>If the start parameter indicates the position of
        a negative truncation or beyond, false is returned. Other versions get
        the string from start.</td></tr></tbody><tbody class="gen-changelog v5-2-2 - 5-2-6"><tr><td>5.1.0</td><td><a href='function.explode.html'>explode</a></td><td>支持负数的  limit</td></tr><tr><td>&nbsp;</td><td><a href='function.md5-file.html'>md5_file</a></td><td>函数改用流 API。这意味着能够配合封装器使用该函数，比如 md5_file('http://example.com/..')。</td></tr><tr><td>&nbsp;</td><td><a href='function.sha1-file.html'>sha1_file</a></td><td>改变函数以使用流 API。这意味着可以使用包装器，比如 sha1_file('http://example.com/..')。</td></tr><tr><td>&nbsp;</td><td><a href='function.str-word-count.html'>str_word_count</a></td><td>新增 charlist 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.substr-compare.html'>substr_compare</a></td><td>允许使用负数的 offset 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.substr-count.html'>substr_count</a></td><td>新增 offset 和 length 参数。</td></tr></tbody><tbody class="gen-changelog v5-1-0"><tr><td>5.0.0</td><td><a href='function.html-entity-decode.html'>html_entity_decode</a></td><td>Support for multi-byte encodings was added.</td></tr><tr><td>&nbsp;</td><td><a href='function.md5.html'>md5</a></td><td>新增 raw_output 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.md5-file.html'>md5_file</a></td><td>新增 raw_output 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.sha1.html'>sha1</a></td><td>新增 raw_output 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.sha1-file.html'>sha1_file</a></td><td>新增 raw_output 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.str-ireplace.html'>str_ireplace</a></td><td>新增 count 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.str-replace.html'>str_replace</a></td><td>新增 count 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.strip-tags.html'>strip_tags</a></td><td>strip_tags 变为二进制安全的。</td></tr><tr><td>&nbsp;</td><td><a href='function.strrpos.html'>strrpos</a></td><td>参数 needle 可以是一个多字符的字符串。</td></tr><tr><td>&nbsp;</td><td><a href='function.strrpos.html'>strrpos</a></td><td>引入 offset 参数。</td></tr></tbody><tbody class="gen-changelog v5-0-0"><tr><td>4.3.3</td><td><a href='function.str-replace.html'>str_replace</a></td><td>函数行为改变。旧的版本中存在一个 BUG &mdash;&mdash; 当 search 和
        replace 两个参数都是数组的时候，将导致空的 search 索引被跳过，但是却没有同时前移 replace 内部指针。该错误发生在 PHP 4.3.3，任何依赖于此 BUG 的脚本应该先除去空的查找值，从而模拟原始的行为。</td></tr><tr><td>&nbsp;</td><td><a href='function.substr-replace.html'>substr_replace</a></td><td>All parameters now accept arrays.</td></tr></tbody><tbody class="gen-changelog v4-3-3"><tr><td>4.3.0</td><td><a href='function.implode.html'>implode</a></td><td>glue变为可选参数</td></tr><tr><td>&nbsp;</td><td><a href='function.setlocale.html'>setlocale</a></td><td>Passing multiple locales became possible.</td></tr><tr><td>&nbsp;</td><td><a href='function.str-rot13.html'>str_rot13</a></td><td>函数行为被修正。在此修正之前，str 参数也会被改变，因为它是通过引用传递的。</td></tr><tr><td>&nbsp;</td><td><a href='function.strcspn.html'>strcspn</a></td><td>新增 start 和 length 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.strip-tags.html'>strip_tags</a></td><td>HTML 注释总是被删除。</td></tr><tr><td>&nbsp;</td><td><a href='function.stristr.html'>stristr</a></td><td>stristr 变为二进制安全的。</td></tr><tr><td>&nbsp;</td><td><a href='function.strrchr.html'>strrchr</a></td><td>该函数是二进制安全的。</td></tr><tr><td>&nbsp;</td><td><a href='function.strspn.html'>strspn</a></td><td>新增 start 和 length 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.strstr.html'>strstr</a></td><td>strstr 成为二进制安全的。</td></tr></tbody><tbody class="gen-changelog v4-3-0"><tr><td>4.2.3</td><td><a href='function.strcoll.html'>strcoll</a></td><td>函数在 Win32 平台可用。</td></tr></tbody><tbody class="gen-changelog v4-2-3"><tr><td>4.2.0</td><td><a href='function.setlocale.html'>setlocale</a></td><td>Passing category as a string is now deprecated,
        use the above constants instead.  Passing them as a string (within
        quotes) will result in a warning message.</td></tr></tbody><tbody class="gen-changelog v4-2-0"><tr><td>4.1.0</td><td><a href='function.htmlentities.html'>htmlentities</a></td><td>The encoding parameter was added.</td></tr><tr><td>&nbsp;</td><td><a href='function.htmlspecialchars.html'>htmlspecialchars</a></td><td>The encoding parameter was added.</td></tr><tr><td>&nbsp;</td><td><a href='function.ltrim.html'>ltrim</a></td><td>新增 charlist 参数</td></tr><tr><td>&nbsp;</td><td><a href='function.rtrim.html'>rtrim</a></td><td>新增 charlist 参数。</td></tr><tr><td>&nbsp;</td><td><a href='function.trim.html'>trim</a></td><td>新增可选的 charlist 参数。</td></tr></tbody><tbody class="gen-changelog v4-1-0"><tr><td>4.0.6</td><td><a href='function.sprintf.html'>sprintf</a></td><td>Support for argument numbering/swapping was added</td></tr></tbody><tbody class="gen-changelog v4-0-6"><tr><td>4.0.5</td><td><a href='function.nl2br.html'>nl2br</a></td><td>nl2br 成为 XHTML 兼容的操作。所有的旧版本都会在 string 的新行之前插入 '&lt;br&gt;' 而不是 '&lt;br /&gt;'。</td></tr><tr><td>&nbsp;</td><td><a href='function.str-replace.html'>str_replace</a></td><td>大多数参数都可以为数组。</td></tr></tbody><tbody class="gen-changelog v4-0-5"><tr><td>4.0.3</td><td><a href='function.htmlentities.html'>htmlentities</a></td><td>The flags parameter was added.</td></tr><tr><td>&nbsp;</td><td><a href='function.parse-str.html'>parse_str</a></td><td>添加了参数 arr</td></tr><tr><td>&nbsp;</td><td><a href='function.wordwrap.html'>wordwrap</a></td><td>新增可选的 cut 参数。</td></tr></tbody><tbody class="gen-changelog v4-0-3"><tr><td>4.0.1</td><td><a href='function.explode.html'>explode</a></td><td>增加了参数 limit</td></tr></tbody></table>
 </div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.wordwrap.html">wordwrap</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="refs.basic.vartype.html">变量与类型相关扩展</a></div>
 <div class="up"><a href="book.strings.html">字符串</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
